//业务处理系统&接访咨询相关
import request from "@/api/request.js";

//业务员写入上方记录
export const recordService = Data => {
  return request.post("/api-self/consulting/recordConsultation", Data);
};

//信访事件审核
export const sureService = Data => {
  return request.post("/api-self/petitions/add", Data);
};

//查询信访事件
export const queryPetitionService = petitionId => {
  return request.get(`/api-self//petitions/query/${petitionId}`);
};

//更新信访事件
export const updatePetitionService = DataObj => {
  let url = `/api-self/petitions/update/${DataObj.petitionId}`;
  let Data = {
    eventId: DataObj.eventId,
    status: DataObj.status
  };
  return request.put(url, Data);
};

//信访事件不予审批
export const refuseService = eventId => {
  return request.post(`/api-self/petitions/refuse/${eventId}`);
};

//直接回复信访事件
export const replyPetitionService = Data => {
  return request.post("/api-self/petitions/reply", Data);
};

//转送信访事件
export const tranService = DataObj => {
  return request.post("/api-self/petitions/transfer", DataObj);
};

//信访事件完成
export const finishService = DataObj => {
  return request.post("/api-self/petitions/approve", DataObj);
};

//申请延期办理
export const delayService = Data => {
  return request.post("/api-self/petitions/extension", Data);
};

//处理：获取所有审核通过的记录
export const getAllDetailService = () => {
  return request.get("/api-self/petitions/getApproved");
};

//审核：获取所有待审核记录（即用户新提交的信访记录）
export const getNewService = () => {
  return request.get("/api-self/petitions/getNotApproved");
};

//获取当前业务员待处理的所有记录
export const getWorkerTaskService = Data => {
  return request.get("/api-self/petitions/getEventByWorkId", Data);
};
